﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="HashMap.DictionaryEnumerator.cs" company="JDML Consulting Ltd.">
//   Copyright 2011 Photon Project - http://photon.codeplex.com
// </copyright>
// <summary>
//   Defines the HashMap type.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace Photon.Collections
{
    using System.Collections;

    public partial class HashMap<TKey, TValue>
    {
        private class DictionaryEnumerator : IDictionaryEnumerator
        {
            private readonly Enumerator _enumerator;

            public DictionaryEnumerator(HashMap<TKey, TValue> map)
            {
                _enumerator = new Enumerator(map);
            }

            #region IDictionaryEnumerator Members

            public object Key
            {
                get { return _enumerator.Current.Key; }
            }

            public object Value
            {
                get { return _enumerator.Current.Value; }
            }

            public DictionaryEntry Entry
            {
                get { return new DictionaryEntry(Key, Value); }
            }

            public object Current
            {
                get { return _enumerator.Current; }
            }

            public bool MoveNext()
            {
                return _enumerator.MoveNext();
            }

            public void Reset()
            {
                _enumerator.Reset();
            }

            #endregion
        }
    }
}
